/*
 * @创建文件时间: 2021-08-22 09:45:19
 * @Auther: 猿小天
 * @最后修改人: 猿小天
 * @最后修改时间: 2021-08-23 23:06:13
 * 联系Qq:1638245306
 * @文件介绍:
 */
export const crudOptions = (vm) => {
  return {
    pageOptions: {
      compact: true
    },
    options: {
      height: '100%'
    },
    viewOptions: {
      componentType: 'form'
    },
    formOptions: {
      defaultSpan: 12 // 默认的表单 span
    },
    indexRow: { // 或者直接传true,不显示title，不居中
      title: '序号',
      align: 'center',
      width: 100
    },
    rowHandle: false,
    columns: [
      {
        title: '任务状态',
        key: 'status',
        sortable: true,
        search: {
          disabled: true
        },
        type: 'input',
        form: {
          component: {
            span: 12
          }
        }
      },
      {
        title: '运行时间',
        key: 'run_time',
        search: {
          disabled: false
        },
        type: 'datetime',
        form: {
          component: {
            props: {
              format: 'yyyy-MM-dd HH:mm:ss',
              'value-format': 'yyyy-MM-dd HH:mm:ss'
            }
          }
        }
      },
      {
        title: '运行时长(秒)',
        key: 'duration',

        search: {
          disabled: false
        },
        type: 'number'

      },
      {
        title: '完成时间',
        key: 'finished',
        search: {
          disabled: true
        },
        type: 'datetime'

      },
      {
        title: '异常',
        key: 'exception',
        search: {
          disabled: true
        },
        type: 'input'

      }
    ].concat(vm.commonEndColumns({ show_create_datetime: false, show_datetime: false }))
  }
}
